from rest_framework_mongoengine import serializers
from .models import Spit
# 吐槽序列化器
class TalkSerializers(serializers.DocumentSerializer):
    class Meta:
        # 指定模型类
        model=Spit
        # 指定字段
        fields = '__all__'

    # def validate(self, attrs):
    #     # 提取参数
    #     thumbpub = attrs.get('thumbup')
    #     new_thumbpub = thumbpub + 1
    #     attrs[thumbpub] = new_thumbpub
    #     return attrs

